Change in openvpn[master]: route: handle default gateway (net_gateway) and nexthop towards VPN s...
A message that is not in the archive (sent off-list or not yet received): gerrit.1740476988000.Ifc54be34101c0eb0f3dc479a9480d7219628cc76@...2715...
Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/902?usp=email
to review the following change.
Change subject: route: handle default gateway (net_gateway) and nexthop towards VPN server separately
......................................................................
route: handle default gateway (net_gateway) and nexthop towards VPN server separately
Right now there is the assumption that the gateway used for net_gateway is the same used to reach the VPN server. However, these two gateways may be different (i.e. when there is a specific hostroute for the VPN server using a different nexthop). For this reason we must adapt init_route_list() to fetch the two gateways separately.
Change-Id: Ifc54be34101c0eb0f3dc479a9480d7219628cc76
---
M src/openvpn/route.c
1 file changed, 14 insertions(+), 6 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/02/902/1
src/openvpn/route.c +14 -6
@@ -655,10 +655,12 @@ rl->spec.flags |=RTSA_DEFAULT_METRIC ; } -get_default_gateway (&rl->rgi, remote_host !=IPV4_INVALID_ADDR ? remote_host :INADDR_ANY , ctx); -if (rl->rgi.flags &RGI_ADDR_DEFINED ) +struct route_gateway_info ngi; + +get_default_gateway (&ngi,INADDR_ANY , ctx); +if (ngi.flags &RGI_ADDR_DEFINED ) { -setenv_route_addr (es,"net_gateway" , rl->rgi.gateway.addr,-1 ); +setenv_route_addr (es,"net_gateway" , ngi.gateway.addr,-1 );#if defined(ENABLE_DEBUG ) && !defined(ENABLE_SMALL )print_default_gateway (D_ROUTE , &rl->rgi,NULL );#endif
@@ -668,6 +670,8 @@dmsg (D_ROUTE ,"ROUTE: default_gateway=UNDEF" ); } +get_default_gateway (&rl->rgi, remote_host !=IPV4_INVALID_ADDR ? remote_host :INADDR_ANY , ctx); +if (rl->spec.flags &RTSA_REMOTE_HOST ) { rl->spec.remote_host_local =test_local_addr (remote_host, &rl->rgi);
@@ -818,10 +822,12 @@msg (D_ROUTE ,"GDG6: remote_host_ipv6=%s" , remote_host_ipv6 ?print_in6_addr (*remote_host_ipv6,0 , &gc) :"n/a" ); -get_default_gateway_ipv6 (&rl6->rgi6, remote_host_ipv6, ctx); -if (rl6->rgi6.flags &RGI_ADDR_DEFINED ) +struct route_ipv6_gateway_info ngi6; + +get_default_gateway_ipv6 (&ngi6,NULL , ctx); +if (ngi6.flags &RGI_ADDR_DEFINED ) { -setenv_str (es,"net_gateway_ipv6" ,print_in6_addr (rl6->rgi6.gateway.addr_ipv6,0 , &gc)); +setenv_str (es,"net_gateway_ipv6" ,print_in6_addr (ngi6.gateway.addr_ipv6,0 , &gc));#if defined(ENABLE_DEBUG ) && !defined(ENABLE_SMALL )print_default_gateway (D_ROUTE ,NULL , &rl6->rgi6);#endif
@@ -831,6 +837,8 @@dmsg (D_ROUTE ,"ROUTE6: default_gateway=UNDEF" ); } +get_default_gateway_ipv6 (&rl6->rgi6, remote_host_ipv6, ctx); +if (is_route_parm_defined ( remote_endpoint )) { if (inet_pton( AF_INET6, remote_endpoint,
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/902?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ifc54be34101c0eb0f3dc479a9480d7219628cc76
Gerrit-Change-Number: 902
Gerrit-PatchSet: 1
Gerrit-Owner: mrbff <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange
mrbff has abandoned this change. ( http://gerrit.openvpn.net/c/openvpn/+/902?usp=email )
Change subject: route: handle default gateway (net_gateway) and nexthop towards VPN server separately
......................................................................
Abandoned
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/902?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ifc54be34101c0eb0f3dc479a9480d7219628cc76
Gerrit-Change-Number: 902
Gerrit-PatchSet: 1
Gerrit-Owner: mrbff <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: abandon